﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Gencode.Common.Errorhandling
{
    public class UserException : Exception
    {
        public UserException()
        {
			Util.ErrorHandler.LoggError(base.Message);
        }

        public UserException(string message)
            : base(message)
        {
			Util.ErrorHandler.LoggError(base.Message);
        }

        public UserException(string message, Exception inner)
            : base(message, inner)
        {
			Util.ErrorHandler.LoggError("Unhandled exception", base.Source, base.Data.ToString());
        }

		public UserException(string message, bool generateMessageBox)
			: base(message)
		{
			Util.ErrorHandler.LoggError("Unhandled exception", base.Source, base.Message);

			if (generateMessageBox)
				Util.ErrorHandler.ShowError(message);
		}
    }
}
